#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"mysql/mysql.h"
int main(int argc,char* argv[])
{
    MYSQL my_connection;
    int res;
    char cmd[300];
    mysql_init(&my_connection);
    if(mysql_real_connect(&my_connection,"localhost","root","xxx",
                "database_flow",0,NULL,CLIENT_FOUND_ROWS))
    {
        printf("Connection success\n");
        sprintf(cmd,"delete from table_flow_test where PKG_SIZE_5=0");
        res=mysql_query(&my_connection,cmd);
        if(!res)
        {
            printf("Inserted %lu rows\n",(unsigned long)mysql_affected_rows(&my_connection));
        }
        else
        {
            printf("Inset error %d: %s\n",mysql_errno(&my_connection),mysql_error(&my_connection));
        }
        mysql_close(&my_connection);
    }
    else
    {
        printf("Connection failed\n");    
        if(mysql_errno(&my_connection))
            printf("Connection error %d: %s\n",mysql_errno(&my_connection),mysql_error(&my_connection));
    }
    return EXIT_SUCCESS;
}
